		/*添加*/
		function u_coupon_add(title, url, w, h) {
			layer_show(title, url, w, h);
		}

		function u_coupon_save_submit(){
			document.getElementById("description").value = $('#summernote').summernote('code');
			$("#form-u_coupon-add").Validform({
				tiptype:2,
				ajaxPost:true,
				callback:function(form){
					var index = parent.layer.getFrameIndex(window.name);
					if (index){//关闭弹出层
						parent.$('.btn-refresh').click();
						parent.layer.close(index);
					}else{//单独的页面
						location.href = web_path+"/backstage/coupon-list";
					}
				}
			});
		}

		function add_new_charge() {
			
			var rowLen = $('#charge').find('tbody tr').length + 1;
			var html = "<tr><td class='col-xs-1'>"
					+ rowLen
					+ "</td><td class='col-xs-3'><input type='text'"
					+ "class='form-control' style='min-width: 10px'"
					+ "name='coupon_amout' datatype='*1-50' nullmsg='填写优惠金额'"
					+ "value=''></td>"
					+ "<td class='col-xs-1'><input type='text'"
					+ "	class='form-control' style='min-width: 10px' name='use_limit1'"
					+ "	value=''></td>"
					+ "	<td class='col-xs-2'><input type='text'"
					+ "	class='form-control' style='min-width: 10px'"
					+ "	name='coupon_count' datatype='n1-10' nullmsg='不能为空并且必须是整数'"
					+ "	value=''></td><td class='col-xs-2'><input type='text' id='end_time"+rowLen+"' name='end_time'  readonly class='input-text Wdate' style='min-width: 10px'></td>	"
					+"<td class='col-xs-1'><button class='btn btn-warning radius' type='button'>"
					+"<i class='fa fa-remove'>&#xe632;</i> 删除</button></td></tr>";
			$('#charge').find('tbody').append(html);
			$('#charge').find('tbody tr:last').find('button').on('click',
			function() {
				$(this).parent().parent().remove();
				$('#charge').find('tbody tr').each(function() {
					var rowIndex = $(this).index() + 1;
					$(this).find('td:eq(0)').text(rowIndex);
				})
			});
			
			$('#end_time'+rowLen).on('click',function() {				
				WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'});			
			});
		}

		function coupon_disable(obj){
			$(obj).parent().parent().remove();
		}

	
